package org.example.first_demo.controler;

import org.example.first_demo.config.NacosConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class NacosController {

    @Autowired
    private NacosConfig nacosConfig;  // 注入 NacosConfig

    @GetMapping("/get-config")
    public String getConfig() {
        return nacosConfig.getDemoMsg();  // 返回 Nacos 配置的值
    }
}
